package bpm.dao.impl.foreignactive;

import java.util.List;
import javax.annotation.Resource;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;
import bpm.dao.foreignactive.ForeignActiveDao;
import bpm.domain.foreignactive.ForeignActiveView;

/**
 * 
 * @author zhangxue
 *
 */
@Repository("foreignActiveDao")
public class ForeignActiveDaoImpl implements ForeignActiveDao{
	
	@Resource
	private JdbcTemplate jdbcTemplate;
		
	public int findForeignActiveCount(String count, Object... obj) {
		return this.jdbcTemplate.queryForInt(count,obj);		
	}
		
	@SuppressWarnings("unchecked")
	public List<ForeignActiveView> findForeignActiveList(String sql,
			Object... obj) {	
		return this.jdbcTemplate.query(sql, obj,new ForeignActiveRowMapper());
	}
					
	public void addForeignActive(String sql,Object...obj) {
		this.jdbcTemplate.update(sql,obj);		
	}
	
	public void updateForeignActive(String sql, Object...obj) {
		this.jdbcTemplate.update(sql, obj);		
	}
	
	public void deleteForeignActive(String sql){		
		this.jdbcTemplate.update(sql);		
	}
	
	@SuppressWarnings("unchecked")
	public List<ForeignActiveView> checkForeignActive(String sql) {
		return this.jdbcTemplate.query(sql, new ForeignActiveRowMapper());		
	}
		
	}
	
	


